import commpackage.*;

public class TestCommServer {

	/**
	 * @param args
	 */
	public static void main(String[] args) {

		ConnectionType type = new ConnectionType();
		type.setHostname("localhost");
		type.setPort(3000);
		type.setServer(true);
		type.setSecurity(false);
		CommFactory fact = new CommFactory(); // This will no be called
		TestCallback cb = new TestCallback();

		System.out.println("Getting Comm Instance");
		Comm com = (Comm)fact.getCommInstance();

		System.out.println("Starting New Server Session");
		int session_id = com.newSession(cb, type);
		com.connect(session_id);
		com.getConnections(session_id);

		while(!cb.needStop())
		{
			try
			{
				Thread.sleep(1000);
			}
			catch(Exception e)
			{

			}
		}
		com.disconnect(session_id);
	}

}
